<template>
  <a-drawer
    title="考生详细信息"
    wrapClassName="fullscreen"
    height="100%"
    placement="bottom"
    :closable="false"
    @close="handleCancel"
    :visible="previewVisible" >
    <a-form class='detailForm'>
      <a-row :gutter="48" style="width:100%">
          <a-col :md="18" :sm="24">
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="报考号"
                >
                {{info.ksbmh}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="准考证号"
                >
                {{info.ksbh}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="姓名"
                >
                {{info.ksxm}}
                </a-form-item>
            </a-col>
             <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="性别"
                >
                {{info.xbm =='2'?'女':'男'}}
                </a-form-item>
            </a-col>
             <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="出生日期"
                >
                {{info.csrq && info.csrq._i?info.csrq._i:''}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="民族"
                >
                {{info.mzm}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="中华人名共和国居民身份证"
                >
                {{info.zjhm}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="政治面貌"
                >
                {{info.zzmmm}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="是否军人"
                >
                {{info.xyjrm}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="毕业学校"
                >
                {{info.dxbyxxmc}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="毕业专业"
                >
                {{info.dxbyxymc}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="最后学历情况"
                >
                {{info.zhxlm}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="最后学位情况"
                >
                {{info.zhxlm}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24" :style="{width:info.xzgzdw && info.xzgzdw.length>20?'66%':''}">
                <a-form-item
                    label="工作单位"
                >
                {{info.xzgzdw}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24" :style="{width:info.daszdwdz && info.daszdwdz.length>20?'66%':''}">
                <a-form-item
                    label="通讯地址"
                >
                {{info.txdz}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="邮政编码"
                >
                {{info.yzbm}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="联系电话"
                >
                {{info.gddh}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="移动电话"
                >
                {{info.yddh}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="电子邮箱"
                >
                {{info.dzxx}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="档案所在单位"
                >
                {{info.daszdw}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24" :style="{width:info.daszdwdz && info.daszdwdz.length>20?'66%':''}">
                <a-form-item
                    label="档案单位地址"
                >
                {{info.daszdwdz}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="档案单位邮编"
                >
                {{info.daszdwyb}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="考生来源"
                >
                {{info.kslym}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="考试方式"
                >
                {{info.ksfsm}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="报考院系"
                >
                {{info.bkyxsmc}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="报考专业"
                >
                {{info.bkzymc}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="研究方向"
                >
                {{info.bkyjfxmc}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="政治理论"
                >
                {{info.zzllcj}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="外国语"
                >
                {{info.wgycj}}
                </a-form-item>
            </a-col>
          <!--  <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="汉语基础"
                >
                {{info.hyjc}}
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="汉语国际教育基础"
                >
                {{info.hygjjyjc}}
                </a-form-item>
            </a-col> -->
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="总成绩"
                >
                {{info.cszcj}}
                </a-form-item>
            </a-col>
            <a-col :lg="24" :md="24" :sm="24">
                <a-form-item
                    label="备注"
                >
                {{info.note?info.note:'无'}}
                </a-form-item>
            </a-col>
          </a-col>
          <a-col :md="6" :sm="24">
              <img style="display:block;width:100%" :src="info.tpdz" />
          </a-col>
    </a-row>
    </a-form>
    <div class="drawer-bootom-button" style="z-index:1">
        <div style="float:right">
            <a-button type="primary" @click="handleCancel">关闭窗口</a-button>
        </div>
    </div>
  </a-drawer>
</template>

<script>
import moment from 'moment'
export default {
  props: {
    previewVisible: {
      default: false
    },
    info: {
      default: () => ({})
    }
  },
  data () {
    return {
      loading: false,
      postParams: {},
      imageUrl: '',
      selectMenu: {
        yx: [] // 院系
      },
      // 当前所在信息节点
      infoIdx: 0
    }
  },
  watch : {
    info(){
         if(this.info.csrq){
          this.info.csrq._i= moment(this.info.csrq._i).format('YYYY-MM-DD')
        }
      console.log(document.getElementsByClassName('detailForm'))
      if(this.info.tpdz){
        this.info.tpdz = process.env.IMG_URL + this.info.tpdz
      }else{
        this.info.tpdz =require('../../../assets/icon_head_address.png')
      }
      if(document.getElementsByClassName('detailForm').length){
         console.log((document.body.clientHeight-120)+"px")
        document.getElementsByClassName('detailForm')[0].style.height = (document.body.clientHeight-120)+"px"
      }
       if(document.getElementsByClassName('ant-form-item-label')){
          for(var i=0;i<document.getElementsByClassName('ant-form-item-label').length;i++){
             document.getElementsByClassName('ant-form-item-label')[i].style.overflow = 'visible'

          }

      }
    }
  },
  methods: {
    // 关闭
    handleCancel () {
      this.$emit('close')
    }
  }
}
</script>

<style lang="less" scoped="">
.fullscreen{
    .ant-drawer-wrapper-body{
        height: 100%;
        overflow: auto;
    }
}
.ant-row.ant-form-item{display: flex}
.ant-col-sm-24.ant-col-md-6{width: 260px;height: 260px}
</style>
